<?php
/**
 * Created by PhpStorm.
 * User: changyifan
 * Date: 2018/3/6
 * Time: 下午2:37
 */

namespace Home\Dao;
use Think\Model\BaseDao;

class TeacherDao extends BaseDao{

    protected $_map = array(
        'sd_boss_add'                => 'sch_id',
        'de_boss_add'                => 'dept_id',
        'add_teacher_id'             => 'tea_id',
        'add_teacher_name'           => 'tea_name',
        'add_teacher_zhi'            => 'tea_zhi',
        'add_teacher_sex'            => 'tea_sex',
        'add_teacher_birthday'       => 'tea_bir',
        'add_teacher_status'         => 'tea_status',
        'sd_boss_edit'               => 'sch_id',
        'de_boss_edit'               => 'dept_id',
        'edit_teacher_id'            => 'tea_id',
        'edit_teacher_name'          => 'tea_name',
        'edit_teacher_zhi'           => 'tea_zhi',
        'edit_teacher_sex'           => 'tea_sex',
        'edit_teacher_birthday'      => 'tea_bir',
        'edit_teacher_status'        => 'tea_status',
        'delete_teacher_id'          => 'tea_id',
    );
    protected $_validate = array(
        array('sch_id','0','请选择所属学院',0,'notequal'),
        array('dept_id','0','请选择所属系部',0,'notequal'),
        array('tea_id','require','教师编号不能为空'),
        array('tea_name','require','教师名称不能为空'),
        array('tea_zhi','0','请选择教师职称',0,'notequal'),
        array('tea_sex','0','请选择教师性别',0,'notequal'),
        array('tea_bir','require','教师生日不能为空'),
        array('tea_status','0','请选择教师状态',0,'notequal'),
    );
    protected $_auto = array(
        array('tea_zhi','getTeaZhiByValue',3,'function'),
        array('tea_sex','getTeaSexByValue',3,'function'),
        array('tea_status','getTeaStatusByValue',3,'function'),
    );

}